package com.moli.iov.base.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.moli.iov.base.model.dto.req.VehicleAttentionReqDto;
import com.moli.iov.base.model.po.VehicleAttention;
import com.moli.iov.rest.RestResponse;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 车辆关注表 服务类
 * </p>
 *
 * @author wanghualin
 * @since 2019-09-03
 */
public interface IVehicleAttentionService extends IService<VehicleAttention> {

  /**
   * 车辆关注
   * @param vehicleAttentionReqDto
   * @return RestResponse
   */
  public RestResponse saveVehicleAttention(VehicleAttentionReqDto vehicleAttentionReqDto);

  /**
   * 车辆取消关注 删除缓存
   * @param vehicleAttentionReqDto
   * @return RestResponse
   */
  public RestResponse updateVehicleAttention(VehicleAttentionReqDto vehicleAttentionReqDto);

  /**
   * According to attention user id and follow group id for get vehicle number collection.
   * @param userId Attention user id.
   * @param groupId Follow group id.
   * @return Vehicle number collection.
   */
  public Set<String> findByUserIdAndGroupId(Long userId, Long groupId);

  /**
   * 获得用户关注
   * @param vin
   * @param userId
   * @param groupId
   * @return Vehicle attention model.
   */
  VehicleAttention getVehicleAttentionByVin(String vin, Long userId, Long groupId);

  /**
   * 批量添加 关注
   * @param list
   * @param userId
   * @param groupId
   */
  void saveBatchVehicleAttention(List<VehicleAttention> list, Long userId, Long groupId);

  /**
   * 初始化
   */
  void initVehicleAttention();

  /**
   * 批量删除
   * @param list
   * @param sysUserId
   * @param groupId
   */
  void deleteBatchVehicleAttention(List<VehicleAttention> list, Long sysUserId, Long groupId);


  /**
   *
   * According to vehicle number collection and attention user id and follow group id for get vehicle attention collection.
   *
   * @param vinList
   * @param userId
   * @param groupId
   * @return Vehicle attention collection.
   */
  List<VehicleAttention> listVehicleAttentionByVin(List<String> vinList,Long userId, Long groupId);

  boolean removeByUserIdAndGroupId(Long userId, Long groupId);
}
